<template>
  <div>
    御剑乘风来,除魔天地间!==son1==={{$store.state.app}}==={{$store.state.user.age}}==={{ age }}
    <button
      @click="changeAge"
    >按钮</button>
    <button @click="$store.commit('user/changeAge')">按钮</button>
    <button @click="syncHandle">按钮===sync</button>
    <button @click="$store.dispatch('user/syncHandle')">按钮===sync</button>
  </div>
</template>
<script>
import { mapState, mapMutations, mapActions } from 'vuex'
export default {
  name: 'Son1',
  data () {
    return {

    }
  },
  created () {
  },
  computed: {
    ...mapState('user', ['age'])
  },
  methods: {
    ...mapMutations('user', ['changeAge']),
    ...mapActions('user', ['syncHandle'])
  }
}
</script>
<style lang='less'  scoped>
</style>